import type { Ref } from 'vue'

/**
 * 获取ref source
 * @param source 参考watch 函数传参
 * @returns
 */
export function getSource<T = any>(source: RefSource<T>): Ref<T> {
  return isRef(source) ? source : computed(source)
}
